<template>
  <div class="box">
    <div class="top">
      <p class="title">实时游客统计</p>
      <p class="bg"></p>
      <p class="right">可预约总量<span>99999</span>人</p>
    </div>
    <div class="number">
      <span v-for="(item, index) in people" :key="index">{{ item }}</span>
    </div>
    <div class="charts" ref="charts"></div>
  </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue"
// 水球图拓展插件
import 'echarts-liquidfill'
import * as echarts from 'echarts';
let people = ref('216908人')
let charts = ref()

onMounted(() => {
  let myChart = echarts.init(charts.value)
  myChart.setOption({
    title: {
      text: '水球图'
    },
    xAxis: {},
    yAxis: {},

    series: {
      type: 'liquidFill',
      data: [0.6],
      waveAnimation: true,
      animationDuration: 3,
      animationDurationUpdate: 0,
      radius: '90%',
      outline: {
        show: true,
        borderDistance: 8,
        itemStyle: {
          color: 'skyblue',
          borderColor: '#294D99',
          borderWidth: 8,
          shadowBlur: 20,
          shadowColor: 'rgba(0, 0, 0, 0.25)'
        }
      }
    },
    grid: {
      left: 0,
      right: 0,
      bottom: 0,
      top: 0
    }
  })
})

</script>

<style lang="scss" scoped>
.box {
  margin-top: 10px;
  background: url(../images/dataScreen-main-lb.png) no-repeat;
  background-size: 100% 100%;

  .top {
    margin-left: 20px;

    .title {
      color: white;
      font-size: 20px;

    }

    .bg {
      width: 68px;
      height: 7px;
      background: url(../images/dataScreen-title.png) no-repeat;
      background-size: 100% 100%;
      margin-top: 8px;
    }

    .right {
      float: right;
      color: white;

      span {
        color: yellowgreen;
      }

    }
  }

  .number {
    padding: 20px 30px;
    margin-top: 30px;
    display: flex;

    span {
      flex: 1;
      text-align: center;
      height: 40px;
      line-height: 40px;
      background: url(../images/total.png) no-repeat;
      background-size: 100% 100%;
      color: #29fcff;
    }
  }



  .charts {
    width: 100%;
    height: 250px;

  }
}
</style>
